home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / CChoicesButton 1.0 / READ ME < prev    next >
Encoding:
Text File  |  1994-11-30  |  2.1 KB  |  45 lines  |  [TEXT/R*ch]

  1. Name: CChoicesButton
  2. Version: 1.0
  3. Category: classes
  4. Contributor: Michael Abramowicz <MBABRAMOWICZ@AMHERST.EDU>
  5. Date: 93-07-06
  6. TCL-Version: 1.1.3
  7. TCL-Language: C++
  8. Copyright: Copyright (C) 1993 Michael Abramowicz. All rights reserved.
  9.  
  10. The ChoicesButton Class
  11.                             
  12. A button that can make a window/dialog bigger ("More Choices") or 
  13. smaller ("Fewer Choices"). When More Choices is clicked, a range of 
  14. view items, set with the SetViewsToHide method, will be hidden. Another
  15. range of items, specified with the SetViewsToMoveUp method, will move
  16. upwards so that the top of the highest of the items to be moved
  17. is where the highest of the items that were hidden was. 
  18. The bottom of the window enclosing the items will move up as
  19. well. These effects will be reversed when the button is hit again.
  20. This approach allows you to have a choices button that hides items
  21. in the middle of the dialog window.
  22.     
  23. Ordinarily, you will have at least one item to be moved up, the choices
  24. button itself. However, if the choices button for some reason is on the 
  25. top of the dialog, and the items to be hidden are at the bottom, then
  26. to ensure that the window itself shrinks when items are hidden, you should
  27. add an invisible item to the window, such that the top of the item is the
  28. bottom of the lowest item that you want hidden. Then specify this item as
  29. the only item to be moved up.
  30.     
  31. If you wish the ChoicesButton dialog to do more than simply hide and
  32. move items (for example, you want some items to change into other items,
  33. or you want a whole new dialog setup) then you can override this class’s
  34. DoFewerChoices and DoMoreChoices methods.
  35.     
  36. You can create such a button in three ways: through a control template, 
  37. dynamically, or through an overloaded dialog item. With only the last 
  38. of these methods can you specify in the resource file the views that 
  39. should be hidden and moved up.
  40.     
  41. You should always create a window in the more choices state (i.e., so
  42. that the button reads "Fewer Choices"). If you want the window to be
  43. in the fewer choices state initially, then call the DoFewerChoices
  44. method before the window becomes visible.
  45.